package com.example.clxy.dao;

import com.example.clxy.entity.Experiment;
import com.example.clxy.entity.Program;
import com.example.clxy.result.business.PageResult.ExperimentPageResult;
import com.example.clxy.result.business.PageResult.PlatformPageResult;
import com.example.clxy.result.business.PageResult.ProgramPageResult;
import com.example.clxy.result.business.PageResult.SycoursePageResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ProgramMapper {
    int deleteByPrimaryKey(String programid);

    int insert(Program record);

    int insertSelective(Program record);

    Program selectByPrimaryKey(String programid);

    int updateByPrimaryKeySelective(Program record);

    int updateByPrimaryKey(Program record);

    List<ProgramPageResult> getProgramList(@Param("programid") String programid,
                                           @Param("programname") String programname,
                                           @Param("year") String year,
                                           @Param("procode") String procode,
                                           @Param("schoolname") String schoolname,
                                           @Param("status") String status,
                                           @Param("begin") int begin,
                                           @Param("end") int end,
                                           @Param("pagesize") int pagesize);

    int addProgramSycourse(@Param("programid") String programid,
                           @Param("sycourseid") String  sycourseid);

    int addProgramSycourseExperiment(@Param("programid") String programid,
                                     @Param("sycourseid") String sycourseid,
                                     @Param("experimentid") String experimentid);

    int addProgramPlatform(@Param("programid") String programid,
                           @Param("platformid") String  platformid);

    int addProgramPlatformExperiment(@Param("programid") String programid,
                                     @Param("platformid") String platformid,
                                     @Param("experimentid") String experimentid);


    int deleteProgramSycourse(@Param("programid") String programid,
                              @Param("sycourseid") String  sycourseid);

    int deleteProgramSycourseExperiment(@Param("programid") String programid,
                                             @Param("sycourseid") String  sycourseid,
                                             @Param("experimentid") String experimentid);

    int deleteProgramPlatform(@Param("programid") String programid,
                              @Param("platformid") String  platformid);

    int deleteProgramPlatformExperiment(@Param("programid") String programid,
                                        @Param("platformid") String  platformid,
                                        @Param("experimentid") String experimentid);


    List<SycoursePageResult> getAllSycourseOfProgram(@Param("programid") String programid,
                                                     @Param("sycoursename") String sycoursename,
                                                     @Param("begin") int begin,
                                                     @Param("end") int end,
                                                     @Param("pagesize") int pagesize);


    List<PlatformPageResult> getAllPlatformOfProgram(@Param("programid") String programid,
                                                     @Param("platformname") String platformname,
                                                     @Param("begin") int begin,
                                                     @Param("end") int end,
                                                     @Param("pagesize") int pagesize);

    List<ExperimentPageResult> getAllExperimentOfProgramSycourse(@Param("programid") String programid,
                                                                 @Param("sycourseid") String sycourseid,
                                                                 @Param("experimentname") String experimentname,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize);

    List<ExperimentPageResult> getAllExperimentOfProgramPlatform(@Param("programid") String programid,
                                                                 @Param("platformid") String platformid,
                                                                 @Param("experimentname") String experimentname,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize);

    List<Experiment> getExperimentListByProgramSycourse(@Param("programid") String programid,
                                                        @Param("sycourseid") String sycourseid);

    List<Experiment> getExperimentListByProgramPlatform(@Param("programid") String programid,
                                                        @Param("platformid") String platformid);


    void copyProgram(Map<String,Object> map);

    String getProgramPlatformById(@Param("platformid") String platformid,
                                  @Param("programid") String programid);

    String getProgramSycourseById(@Param("sycourseid") String platformid,
                                  @Param("programid") String programid);
}